package com.demo.service;

import com.demo.common.GlobalConstant;
import com.demo.model.Blog;
import com.jfinal.log.Logger;
import com.jfinal.plugin.activerecord.Page;

public class OpuserService {

	private Logger logger = Logger.getLogger(getClass());
	
	private int key ;

	public Page<Blog> relation(int userId , int pageNumber) {
		logger.debug("userId: " + userId);
		return Blog.dao.paginate(pageNumber, GlobalConstant.PAGE_SIZE, "select b.*, u.name", "from blog b inner join opuser u on b.userId=u.id where u.id=?",userId);
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}
}
